//package study.springboot.mvc.support.log;
//
//import ch.qos.logback.classic.pattern.ClassicConverter;
//import ch.qos.logback.classic.spi.ILoggingEvent;
//import lombok.extern.slf4j.Slf4j;
//
//import java.net.InetAddress;
//import java.net.UnknownHostException;
//
//@Slf4j
//public class IPConverter extends ClassicConverter {
//
//    @Override
//    public String convert(ILoggingEvent event) {
//        String ip = null;
//        try {
//            ip = InetAddress.getLocalHost().getHostAddress();
//        } catch (UnknownHostException e) {
//            log.error("获取日志IP异常", e);
//        }
//        return ip;
//    }
//}
